import * as THREE from "three";

export default class MeshLine{
    constructor(geometry){
        //边缘几何体（EdgesGeometry）可以作为一个辅助对象来查看geometry的边缘。
        const edges = new THREE.EdgesGeometry(geometry);
        this.material = new THREE.LineBasicMaterial({color:0xffffff});
        //在若干对的顶点之间绘制的一系列的线。
        const line  = new THREE.LineSegments(edges,this.material);
        this.geometry = edges;
        this.mesh = line;
    }
    remove() {
        this.mesh.remove();
        this.mesh.removeFromParent();
        this.mesh.geometry.dispose();
        this.mesh.material.dispose();
    }
}